package de.hft.st.algodat.ctt.model;


public class Course {

	private String id;
	private String teacher;
	private int lectures;
	private int min_days;
	private int students;
	private boolean double_lectures = false;
	private String cID;

	protected Course(String id, String teacher, int lectures, int min_days,
			int students, String double_lectures) {
		this.id = id;
		this.teacher = teacher;
		this.lectures = lectures;
		this.min_days = min_days;
		this.students = students;
		if (double_lectures.equals("yes")) {
			this.double_lectures = true;
		}
	}

	public Course(Course copyCourse, String cID) {
		this.id = copyCourse.id;
		this.teacher = copyCourse.teacher;
		this.lectures = copyCourse.lectures;
		this.min_days = copyCourse.min_days;
		this.students = copyCourse.students;
		this.double_lectures = copyCourse.double_lectures;
		this.cID = cID;
	}

	@Override
	public String toString() {
		StringBuffer toStr = new StringBuffer();
		toStr.append("Course ID |Teacher   |Lectures  |Min Days  |Students  |Double Lec|\n");
		toStr.append(String.format("%-10s|", id));
		toStr.append(String.format("%-10s|", teacher));
		toStr.append(String.format("%-10s|", lectures));
		toStr.append(String.format("%-10s|", min_days));
		toStr.append(String.format("%-10s|", students));
		toStr.append(String.format("%-10s|\n", double_lectures));
		return toStr.toString();
	}

	public String getId() {
		return id;
	}
	
	public String getCID() {
		return this.cID;
	}

	public String getTeacher() {
		return teacher;
	}

	public int getLectures() {
		return lectures;
	}

	protected int getMin_days() {
		return min_days;
	}

	protected int getStudents() {
		return students;
	}

	protected boolean getDouble_lectures() {
		return double_lectures;
	}
}
